<?php
namespace Admin\Controller;
use Frame\Libs\BaseController;
use Admin\Model\MessageModel;

//定义最终的留言管理类
final class MessageController extends BaseController
{
    //游客留言 只提供删除功能
    public function index()
    {
        $Messages = MessageModel::getInstance()->fetchAll();
        $this->smarty->assign("messages",$Messages);
        $this->smarty->display("Message/index.html");
    }
    public function del()
    {
        $id = $_GET["id"];
        $Message = MessageModel::getInstance()->del($id);
        if($Message){
            $this->jump("删除id={$id}的记录成功","?c=message");
        }else{
            $this->jump("删除id={$id}的记录失败","?c=message");
        }
    }
}